<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
		<div id="box">
			<img src="images/0.JPG" alt="" />
			<img src="images/0.JPG" alt="" />
			<img src="images/0.JPG" alt="" />
			<img src="images/0.JPG" alt="" />
			<img src="images/0.JPG" alt="" />
			<img src="images/0.JPG" alt="" />
			<img src="images/0.JPG" alt="" />
			<img src="images/0.JPG" alt="" />
		</div>
		<script type="text/javascript">
				var aImg=document.getElementsByTagName('img');//一组图片
				function double(num){
					if(num<10){
						return num='0'+num;
					}else{
						return num;
					}
				}
				function time(){
					var d=new Date();
					var h=d.getHours();
					var m=d.getMinutes();
					var s=d.getSeconds();
					var str=double(h)+':'+double(m)+':'+double(s);//12:34:56
					for(var i=0;i<str.length;i++){
						if(i==2 || i==5){
							aImg[i].src='images/mh.jpg';
						}else{
							aImg[i].src='images/'+str[i]+'.jpg';
						}
						
					}
				}
				time();
				setInterval(time,1000);
				
		</script>
	</body>
</html>
